<?php
namespace Admin\Controller;

use Common\Controller\AdminbaseController;
use Common\Model\NewsModel;
use Think\Cache\Driver\Redis;

class SpecialController extends AdminbaseController
{
	protected $news_model;
	
    function _initialize()
    {
        parent::_initialize();
        $this->news_model = D("Common/News");
    }

	
	 /**
     * 添加专题页面
     */
	function specialAdd(){
		$news_id = I("news_id") ? I("news_id") : '';
		$column_id = I("column_id") ? I("column_id") : '';
		$area_id   = I("area_id") ? I("area_id") : '';
		$id_type = '';
		$id_val  = '';
		if($column_id){
			$id_type = "column_id";
			$id_val  = $column_id;
		}else{
			$id_type = "area_id";
			$id_val  = $area_id;
		}
		$column_type_list = array();
		if($id_type == 'column_id') {
			$column_type = M("vrnews1.column_type", 'news_');
			$column_type_list = $column_type->where("column_id = $id_val and status = 1")->field("type_id, name")->select();
		}
		$this->assign("type_list", $column_type_list);

		$news = M("vrnews1.news", NULL);
		$news_info = $news->join("vrnews1.news_video on news_video.news_id = news.news_id",'left')
			->where(array('news.news_id'=>$news_id))->find();
    	//所有关联选手列表
    	$competitor_model = M('vrlive.competitor','live_');
    	$competitor_list = $competitor_model->field('competitor_id,real_name')->select();

		if($news_id){$news_info['news_id'] = $news_id;}
    	$this->assign("competitor_list", $competitor_list);
		$this->assign('id_type',$id_type);
		$this->assign('id_val',$id_val);
		$this->assign('news_info',$news_info);
		$this->assign('news_id',$news_id);
		$this->display('specialadd');
	}

	 /**
     * 添加专题
     */
	function specialAddok(){
		$news = M("vrnews1.news", NULL);
		//接受数据
		$news_id = I("news_id") ? I("news_id") : '';
		$column_id = I("post.column_id") ? I("post.column_id") : '';
		$area_id   = I("post.area_id") ? I("post.area_id") : '';
		$id_type = '';
		$id_val  = '';
		if(I("post.column_id")){
			$id_type = "column_id";
			$id_val  = I("post.column_id");
		}else{
			$id_type = "area_id";
			$id_val  = I("post.area_id");
		}
		$data['column_id']   = $column_id;
		$data['area_id']     = $area_id;
    	$data['title']    = I("post.title");
    	$data['subtitle']    = I("post.subTitle");
    	$data['keywords'] = I("post.keyword");
    	$data['weight']    = (int)(I("post.weight") ? I("post.weight") :'70');
    	$data['tags']     = I("post.tags");
    	$data['abstract'] = I("post.abstract");
		if($id_type == "column_id") {
			$data['type_id'] = I("post.column_type") ? I("post.column_type") : 0;
		}


		$data['top_status']  = I("post.top_status");
		$data['is_watermark']  = I("post.water");
		$pub                = I("post.pub");

		$data['competitor_id']     = I("post.competitor_id");
		
		
		$data['type']='3';

		//验证
		if (!preg_match('/^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/', $data['weight'])) {
    		return $this->error("权重必须为0到255的数字！");
    	}
		
		//上传图片
		if($_FILES['imageFile']['name']){
    		$newsModel = new NewsModel();  //上传封面图
    		$imageUrl = $newsModel->uploadImage();
    		$data['cover_image'] = $imageUrl;
    	}else if(!I("hidimg")){
			$data['cover_image'] = '';
		}

		if(!empty($pub)){
    		if(in_array(1, $pub)){
    			$data['app_pub'] = 1;
    		}else{
    			$data['app_pub'] = 0;
    		}
    		if(in_array(2, $pub)){
    			$data['web_pub'] = 1;
    		}else{
    			$data['web_pub'] = 0;
    		}
    	}

		//保存数据
		if($news_id){
			$name = C('environment')."_special_list_" . $news_id . '_update';
			$add = $news->where('news_id = '.$news_id)->data($data)->save();
		}else{
			$data['news_id'] = time().$this->getRange();
			$name = C('environment')."_special_list_" . $data['news_id'] . '_update';
			$data['create_time'] = date('Y-m-d H:i:s', time());
			$data['refresh_time'] = time();
			$add = $news->add($data);
		}
		if(!empty($add)){
			$redis = new Redis();
			$key = $redis->buildKey($name);
			$redis->set_redis($key, time());
			if($id_type == 'column_id'){
				$column_ids = $data['column_id'];
				$is_area = 0;
			}else if($id_type == 'area_id'){
				$column_ids  = I("area_id");
				$is_area = 1;
			}
			$column_list = C('environment').'_new_list_'.$is_area.'_'.$column_ids.'_update';
			$column_key  = $redis->buildKey($column_list);
			$redis->set_redis($column_key, time());
    		$this->success('发布成功',U('Admin/News/index',array($id_type=>$id_val)));
    	}else{
    		$this->error('发布失败！',U('Admin/Special/specialAdd',array($id_type=>$id_val)));
    	}
	}
  
    /**
     * 专题下的文章列表
     */
    function index()
    {
    	$special_id = I('get.special_id','0');
		$news_id = I('news_id');
		if(!$news_id){
			$this->error("参数有误");
		}
		//查看专题新闻列表
		$column_id = I("column_id") ? I("column_id") : '';
		$area_id   = I("area_id") ? I("area_id") : '';
		$id_type = '';
		$id_val  = '';
		if(I("column_id")){
			$id_type = "column_id";
			$id_val  = I("column_id");
		}else{
			$id_type = "area_id";
			$id_val  = I("area_id");
		}
		if($special_id ){
			//查看详情
			$this->assign("news_id",$news_id);
			$this->assign("id_type",$id_type);
			$this->assign("id_val",$id_val);
			$this->display("Special/specialEdit");
		}else{
			//查看列表
			$formParam['keyword'] = I('param.keyword', '');
			$formParam['source'] = I('param.source', '');
			$formParam['editorName'] = I('param.editorName', '');
			$formParam['startDate'] = I('param.startDate', '');
			$formParam['endDate'] = I('param.endDate', '');
			$formParam['weight'] = I('param.weight', '');
			$formParam['type'] = I('param.type', '');
			$this->assign("formParam", $formParam);

			if(empty($id_type)){
				$this->error("参数错误！");
			}

			$currentPage = I('param.p', 0);
			if ($currentPage <= 0) {
				$currentPage = 1;
			}
 
			$pageSize = '20';
			$pageStart = ($currentPage - 1) * $pageSize;
			$pageEnd = $currentPage * $pageSize;
			$result = $this->news_model->getNewsListBySpecialId($news_id,$formParam,$pageStart,$pageSize);
// echo '<pre>';print_r($result['data']);die;
			if(count($result['data']) >= 1){
				foreach($result['data'] as &$new){
					$new['type_zh'] = A('News')->_getNewType($new);
				}
				unset($new);
			}
	
			//分页
			$page = $this->page($result['count_Total'], 20);
			$this->assign("page", $page->show('Admin'));

			$this->assign("id_type", $id_type);
			$this->assign("id_val", $id_val);
			$this->assign("special_id", $special_id);
			$this->assign("news_id", $news_id);
			$this->assign("data", $result['data']);
			$this->display();
		}
    }
    
    
    /**
     * 删除文章
     */
    function newsDel(){
    	$news_checkbox_ids = implode(',',I("news_checbox"));
		$column_id = I("column_id");
		$is_area = I("is_area");
		$special_news_id = I("special_news_id",0);
		$redis = new Redis();
		if($special_news_id != 0){
			$name = C('environment')."_special_list_" . $special_news_id . '_update';
		}else{
			$name = C('environment').'_new_list_'.$is_area.'_'.$column_id.'_update';
		}
		$key = $redis->buildKey($name);
		$redis->set_redis($key, time());
    	$where['news_id'] = array('IN',$news_checkbox_ids);
    	$result = $this->news_model->where($where)->delete();
		echo $result;exit();
    }
    
    
    /**
     * 专题分栏列表
     *
     */
    public function special_column_index(){
    	$special_id = I("special_id");
    	$column_id = I('column_id') ? I("column_id") : '';
		$area_id   = I("area_id") ? I("area_id") : '';
		$id_type = '';
		$id_val  = '';
		if(I("column_id")){
			$id_type = "column_id";
			$id_val  = I("column_id");
		}else{
			$id_type = "area_id";
			$id_val  = I("area_id");
		}
    	
    	if(!$special_id || !$id_type){
    		$this->error("参数错误！");
    	}
    	$currentPage = I('param.p', 0);
    	if ($currentPage <= 0) {
    		$currentPage = 1;
    	}
    
    	$pageSize = '20';
    	$pageStart = ($currentPage - 1) * $pageSize;
    	$pageEnd = $currentPage * $pageSize;
    	 
    	$typeObj = M("vrnews1.column_type", 'special_');
    	$result= $typeObj->where(array('news_id' => $special_id, 'status'=>1))
    	->Order("weight desc,create_time desc")->limit($pageStart, $pageSize)->select();
    
    	//分页
    	$page = $this->page($result['count_Total'], 20);
    	$this->assign("page", $page->show('Admin'));
    	 
    	$this->assign("id_type", $id_type);
		$this->assign("id_val", $id_val);
    	$this->assign("special_id", $special_id);
    	$this->assign("data", $result);
    	$this->display();
    }
    
    
    
    /**
     * 设置入口
     */
    function entryAdd(){
    	$news_id = I("param.news_id", ""); //新闻ID
    	$special_id = I("param.special_id", ""); //专题ID
		$id_type = I("param.id_type", "");
    	$id_val = I("param.id_val", "");

    	if (empty($special_id)) {
    		$this->error("参数错误！");
    	}
    	$result = $this->news_model->entryAdd($news_id, $special_id);
    	if($result){
			$redis = new Redis();
			$name = C('environment')."_special_list_" . $special_id . '_update';
			$key = $redis->buildKey($name);
			$redis->set_redis($key, time());
			if($id_type == 'column_id'){
				$column_ids = $id_val;
				$is_area = 0;
			}else if($id_type == 'area_id'){
				$column_ids  = $id_val;
				$is_area = 1;
			}
			$column_list = C('environment').'_new_list_'.$is_area.'_'.$column_ids.'_update';
			$column_key = $redis->buildKey($column_list);
			$redis->set_redis($column_key, time());
    		$this->success("设置成功");
    	}else{
    		return $this->error("设置失败");
    	}
    }
    
    
    /**
     * 取消入口
     */
    function entryDel(){
    	$news_id = I("param.news_id", "");
    	$special_id = I("param.special_id", "");
		$id_type = I("param.id_type", "");
		$id_val = I("param.id_val", "");
		if (empty($news_id) || empty($special_id)) {
    		$this->error("参数错误！");
    	}
    	$result = $this->news_model->entryDel($news_id,$special_id);
    	if($result){
			$redis = new Redis();
			$name = C('environment')."_special_list_" . $special_id . '_update';
			$key = $redis->buildKey($name);
			$redis->set_redis($key, time());
			if($id_type == 'column_id'){
				$column_ids = $id_val;
				$is_area = 0;
			}else if($id_type == 'area_id'){
				$column_ids  = $id_val;
				$is_area = 1;
			}
			$column_list = C('environment').'_new_list_'.$is_area.'_'.$column_ids.'_update';
			$column_key = $redis->buildKey($column_list);
			$redis->set_redis($column_key, time());
    		$this->success("取消成功");
    	}else{
    		return $this->error("取消失败");
    	}
    }
    
    

    
    
    /**
     * 添加栏目弹窗
     */
    public function addType(){
    	$special_id = I("special_id");
    	if(!$special_id){
    		$this->error("参数错误！");
    	}
    	$this->assign('special_id',$special_id);
    	$this->display('addtype');
    }
    
    
    /**
     * 添加分栏
     */
    public function addColumnType(){
    	$data['name']   = I("post.name");
    	$data['weight'] = I("post.weight");
    	$data['news_id'] = I("post.special_id");
    	$data['creator_id'] = $_SESSION['ADMIN_ID'];
    	$data['status'] = 1;
    	$data['create_time'] = date('Y-m-d H:i:s', time());
    	$typeObj = M("vrnews1.column_type", 'special_');
    	$type = $typeObj->data($data)->add();
    	if($type){
    		echo 1;exit;
    	}else{
    		echo 2;exit;
    	}
    }
    
    
    /**
     * 修改专题分栏信息
     */
    public function editColumnType(){
    	$type_id = I("type_id");
    	$value   = I("val");
    	$type    = I("type");
    	if($type == 'name'){
    		$data['name'] = $value;
    	}else if($type == 'weight'){
    		$data['weight'] = $value;
    	}
    	$typeObj = M("vrnews1.column_type", 'special_');
    	echo $typeObj->where(array('type_id' => $type_id))->save($data);exit;
    }
    
    
    /**
     * 专题分栏删除
     */
    public function special_column_del(){
    	$type_id = I("type_id");
    	if(!$type_id){
    		$this->error("参数错误！");
    	}
    	$data['status'] = 0;
    	$typeObj = M("vrnews1.column_type", 'special_');
    	$result  = $typeObj->where(array('type_id'=>$type_id))->save($data);
    	if ($result) {
    		$this->success("删除成功！");
    	} else {
    		return $this->error($result['Message']);
    	}
    }
    
    
    /**
     * 修改专题页面
     */
    public function specialEdit(){
    	$news_id = I("news_id");
		$column_id = I("column_id") ? I("column_id") : '';
		$area_id   = I("area_id") ? I("area_id") : '';
		$id_type = '';
		$id_val  = '';
		if(I("column_id")){
			$id_type = "column_id";
			$id_val  = I("column_id");
		}else{
			$id_type = "area_id";
			$id_val  = I("area_id");
		}

    	if(!$id_type){
    		$this->error('参数错误');
    	}
    	
    	$column_type = M("vrnews1.column_type",'news_');
    	$column_type_list = $column_type->where(array($id_type => $id_val, 'status' => 1))->field("type_id, name")->select();
    	$this->assign("type_list", $column_type_list);
    	
    	$news = M("vrnews1.news", NULL);
    	$news_info = $news->find($news_id);
    	
    	//所有关联选手列表
    	$competitor_model = M('vrlive.competitor','live_');
    	$competitor_list = $competitor_model->field('competitor_id,real_name')->select();
    	
    	$this->assign("id_type", $id_type);
		$this->assign("id_val", $id_val);
    	$this->assign("news_info", $news_info);
    	$this->assign("competitor_list", $competitor_list);
    	$this->display('specialedit');
    }
    
    
    /**
     * 专题发布/修改
     */
    
    public function specialEditPost(){
    	$news_id = I("post.news_id","");
    	$data['title']    = I("post.title");
    	$data['subtitle'] = I("post.subTitle");
    	$data['keywords'] = I("post.keyword");
    	$source           = I("post.source");
        $data['weight']    = (int)(I("post.weight") ? I("post.weight") :'70');
    	$data['tags']     = I("post.tags");
    	$data['abstract'] = I("post.abstract");
    	$data['top_status']  = I("post.top_status");
    	$data['special_news_id']  = I("post.special_id",'0');
    	$data['type_id']     = I("post.column_type");
    	$water               = I("post.water");
    	$pub                 = I("post.pub");
    	$reference           = I("post.reference");
    	$data['outer_url']   = I("post.outer_url");
    	$data['is_watermark']      = I("post.water");
    	$news_recommend      = I("post.news_recommend");
    	$data['content'] = json_encode($this->setWatermark($news_id, $data['is_watermark'], $_POST['newsContent']));
    	$data['competitor_id']     = I("post.competitor_id");
    
    	if(!$news_id){
    		$data['news_id'] = time().$this->getRange();
    	}
    	$data['source_name'] = $source;
    	$data['column_id']   = I("column_id");
    	
    	if(mb_strlen(trim($data['subtitle']),'UTF8') > 10){
    		return $this->error("副标题不能超过10个字");
    	}
    	
    	if (!preg_match('/^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/', $data['weight'])) {
    		return $this->error("权重必须为0到255的数字！");
    	}
    	
    	if($_FILES['imageFile']){
    		$newsModel = new NewsModel();  //上传封面图
    		$imageUrl = $newsModel->uploadImage();
    		$data['cover_image'] = $imageUrl;
    	}

    	if(!empty($source)){
	    	$sourceObj = M("vrnews1.news_source", NULL);
	    	$source_item = $sourceObj->where(array('name' => $source))->find();
	    	if(empty($source_item)){
	    		$sourcelist['name'] = $source;
	    		$sourcelist['create_time'] = date('Y-m-d H:i:s', time());
	    		$sourcelist['creator_id']  = $_SESSION['ADMIN_ID'];
	    		$sourceObj->add($sourcelist);
	    		$data['source_id'] = $sourceObj->getLastInsID();
	    	}else{
	    		$data['source_id'] = $source_item['source_id'];
	    	}
    	}
    
    	if(!empty($pub)){
    		if(in_array(1, $pub)){
    			$data['app_pub'] = 1;
    		}else{
    			$data['app_pub'] = 0;
    		}
    		if(in_array(2, $pub)){
    			$data['web_pub'] = 1;
    		}else{
    			$data['web_pub'] = 0;
    		}
    	}
    
    	if(!empty($reference)){
    		$id   = substr($reference, 3);
    		$type = substr($reference, strrpos($reference, '=')+1);
    		$data['reference_id']   = substr($id,0, strpos($id, '&'));
    		$data['reference_type'] = $type;
    	}
    	$data['update_time'] = time();
    	$news = M("vrnews1.news", NULL);
    
    	if($news_id){
    		$news->where('news_id = '.$news_id)->data($data)->save();
    	}else{
    		$data['create_time'] = date('Y-m-d H:i:s', time());
    		if($news->add($data)){
    			$result_news_id = $data['news_id'];
    		}else{
    			$this->error('发布失败');
    		}
    	}
    	if($news_id !=''){
    		$this->success('保存成功！', U("Admin/Special/specialEdit",array('news_id'=>$news_id,'column_id'=>I('column_id'))));
    	}else{
    		$this->success('发布成功！', U("Admin/Special/specialEdit",array('news_id'=>$result_news_id,'column_id'=>I('column_id'))));
    	}
    }
    
    function setWatermark($news_id = null, $is_watermark = null, $content = null){
		// jpg/png 图片处理
		if($news_id){
			$news = M("vrnews1.news", NULL);
			$news_info = $news->find($news_id);
			if($news_info){
				if($is_watermark == '0'){ //不添加水印 将含有 /s 的去掉
					$content = json_encode($content);
					$content = preg_replace('/(src=\\\"http:\\\\\/\\\\\/vrlive-.*?(jpg|png))\\\\\/s/', '$1', $content);
					return json_decode($content);
				}else{ //添加水印 将没有 /s 的添加
					$content = json_encode($content);
					$content = preg_replace('/(src=\\\"http:\\\\\/\\\\\/vrlive-.*?(jpg|png))\\\\\/s/', '$1', $content);
//                    \Think\Log::record($content,"INFO");
					$content = preg_replace('/(src=\\\"http:\\\\\/\\\\\/vrlive-.*?(jpg|png))/', '$1/s', $content);
//                    \Think\Log::record($content,"INFO");
					return json_decode($content);
				}
			}
		}else{
			//添加水印  加 /s
			if($is_watermark == 1){
				$content = json_encode($content);
				$content = preg_replace('/(src=\\\"http:\\\\\/\\\\\/vrlive-.*?(jpg|png))/', '$1/s', $content);
//                \Think\Log::record($content,"INFO");
				return json_decode($content);
			}
		}
		return $content;
    }
    
    //专题嵌套
	public function nestification(){
		$type = I("type",'1'); //默认为1,新闻列表，2时为专题下的新闻列表
		$type_id = I("type_id",''); //对应的专题分栏的id
		$special_id = I("special_id"); //专题id   专题 添加快捷发布传值
		$column_id = I("column_id") ? I("column_id") : '';
		$area_id   = I("area_id") ? I("area_id") : '';
		$id        = I("news_id") ? I("news_id") : '';
		$id_type = '';
		$id_val  = '';
		if($column_id){
			$id_type = "column_id";
			$id_val  = $column_id;
		}else{
			$id_type = "area_id";
			$id_val  = $area_id;
		}
		$news_obj   = M("vrnews1.news", null);
		if(!empty($id)){
			$special_info = $news_obj->where(array('news_id'=>$id))->find();
		}
		$special_column_type = M("vrnews1.column_type",'special_');
		$special_column_list = $special_column_type->where('status = 1 and news_id = '.$special_id)->field('type_id,name')->select();
		$this->assign("type", $type);
		$this->assign("type_id", $type_id);
		$this->assign("special_id", $special_id);
		$this->assign("special_column_type_list", $special_column_list);
		$this->assign('news_info', $special_info);
		$this->assign('id_type',$id_type);
		$this->assign('id_val',$id_val);
		$this->assign('special_id',$special_id);
		$this->display('nestification');
	}

	//专题嵌套入库
	public function add_news(){
		$news = M("vrnews1.news", NULL);
		$reference_id     = I("post.reference_id");  //内链id
		$reference = $news->where(array('news_id'=>$reference_id))->find();
		if(!$reference || $reference['special_news_id'] != '0' || $reference['type'] != '3'){
			return $this->error("内部url必须是专题");
		}
		//接受数据
		$news_id = I("news_id") ? I("news_id") : '';
		$special_id = I("special_id") ? I("special_id") : '';
		$column_id = I("post.column_id") ? I("post.column_id") : '';
		$area_id   = I("post.area_id") ? I("post.area_id") : '';
		$id_type = '';
		$id_val  = '';
		if(I("post.column_id")){
			$id_type = "column_id";
			$id_val  = I("post.column_id");
		}else{
			$id_type = "area_id";
			$id_val  = I("post.area_id");
		}
		$data['column_id']   = $column_id;
		$data['special_news_id'] = $special_id;
		$data['reference_id']    = $reference_id;
		$data['area_id']     = $area_id;
		$data['title']    = I("post.title") ? I("post.title") : $reference['title'];
		$data['subtitle']    = I("post.subTitle") ? I("post.subTitle") : $reference['subtitle'];
		$data['keywords'] = I("post.keyword") ? I("post.keyword") : $reference['keywords'];
		$data['weight']    = (int)(I("post.weight") ? I("post.weight") : $reference['weight']);
		$data['tags']     = I("post.tags");
		$data['abstract'] = I("post.abstract");
		$data['type_id'] = I("post.column_type") ? I("post.column_type") : 0;
		$data['is_watermark']  = I("post.water");
		$pub                = I("post.pub");

		$data['type']='3';

		//验证
		if (!preg_match('/^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/', $data['weight'])) {
			return $this->error("权重必须为0到255的数字！");
		}

		//上传图片
		if($_FILES['imageFile']['name']){
			$newsModel = new NewsModel();  //上传封面图
			$imageUrl = $newsModel->uploadImage();
			$data['cover_image'] = $imageUrl;
		}else{
			$data['cover_image'] = $reference['cover_image'];
		}

		if(!empty($pub)){
			if(in_array(1, $pub)){
				$data['app_pub'] = 1;
			}else{
				$data['app_pub'] = 0;
			}
			if(in_array(2, $pub)){
				$data['web_pub'] = 1;
			}else{
				$data['web_pub'] = 0;
			}
		}

		//保存数据
		if($news_id){
			$add = $news->where('news_id = '.$news_id)->data($data)->save();
		}else{
			$data['create_time'] = date('Y-m-d H:i:s', time());
			$data['refresh_time'] = time();
			$add = $news->add($data);
		}
		$redis = new Redis();
		$name = C('environment')."_special_list_" . $special_id . '_update';
		$key = $redis->buildKey($name);
		$redis->set_redis($key, time());
		if(!empty($add)){
			$this->success('发布成功',U('Admin/News/index',array($id_type=>$id_val)));
		}else{
			$this->error('发布失败！',U('Admin/Special/specialAdd',array($id_type=>$id_val)));
		}
	}
	
	/**
	 * 新闻类型
	 */
	/* private function _getNewType($val){
		if(!$val['type'] || $val['type'] == 0){
			return '未知';
		}
		if($val['type'] == 1){
			return '快捷发布';
		}elseif($val['type'] == 2){
			return '轮播图';
		}elseif($val['type'] == 3){
			return '专题';
		}elseif($val['type'] == 4){
			if($val['video_category'] == 1 || empty($val['video_category'])){
				return '普通视频';
			}else{
				return 'VR视频';
			}
		}elseif($val['type'] == 5){
			return '图集';
		}elseif($val['type'] == 6){
			return '文本';
		}elseif($val['type'] == 7){
			if($val['cover_image']){
				return '图文';
			}else{
				return '文本';
			}
		}else{
			return '未知';
		}
	} */
}